package com.wqh.feign.service.fallback;

import com.wqh.feign.domain.User;
import com.wqh.feign.service.UserService;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author wanqh
 * @date 2018/01/16 14:21
 * @description:
 */
@Component
public class UserServiceFallback implements UserService {


    @Override
    public List<User> findAll() {
        return null;
    }

    @Override
    public User finUserById(@RequestParam("id") Long id) {
        return new User(-1L,"finbyid error",0);
    }

    @Override
    public User findUserHeader(@RequestHeader("name") String name,@RequestHeader("id") Long id,@RequestHeader("age") Integer age) {
        return new User(-1L,"findUserHeader error",0);
    }

    @Override
    public User insertUser(@RequestBody User user) {
        return new User(-1L,"findUserHeader error",0);
    }
}
